<div id="header">
    <div class="headerbox">
        <h1 class="logo"><a href="/"><img src="/front/Content/images/a_03.png" /></a></h1>
        <div class="lxdh">
            <h2>400-625-0083</h2>
        </div>

        <div class="navBar">
            <ul class="nav clearfix">
                <li class="m ">
                    <h3><a href="/">首页</a></h3>
                </li>
                @foreach($menu as $row)
                <li class="m">
                    <h3><a href="{{url($row['controller'].'?catid='.$row['id'])}}" id="{{$row['controller'].$row['id']}}">{{$row['name']}}</a></h3>
                    @if(isset($row['child']))
                    <ul class="sub">
                    	@foreach($row['child'] as $r)
                        <li><a href="{{url($r['controller'].'?catid='.$r['id'])}}">{{$r['name']}}</a></li>
                        
                        @endforeach
                    </ul>
                    @endif
                </li>
                @endforeach

                @guest
                <li class="m" style="padding-left:20px;width: 45px;">
                    <h3><a href="/login">登录</a> / </h3>
                </li>
                <li class="m" style="width:30px;margin-left:.5%;">
                    <h3><a href="/register">注册</a></h3>
                </li>
                @else
                <li class="m">
                    <h3><a href="/home">个人中心</a></h3>
                    <ul class="sub">
                        <li><a href="/home">我的档案</a></li>
                        <li><a href="/user/myCard">名片宝库</a></li>
                        <li><a href="/user/sendService">我要发布</a></li>
                        <li><a href="/user/dataCenter">我的留言</a></li>
                        <li><a href="/user/buyRecord">购买记录</a></li>
                        <li><a href="javascript:;" onclick="$('#logout-form').submit()">退出</a></li>
                    </ul>
                    <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                                            {{ csrf_field() }}
                    </form>
                </li>
                @endguest
                
            </ul>
        </div>
        <script type="text/javascript">
            $(document).ready(function () {
                $('.nav li').hover(function () {
                    $('ul', this).slideDown(200);
                    $(this).children('a:first').addClass("on");
                }, function () {
                    $('ul', this).slideUp(100);
                    $(this).children('a:first').removeClass("on");
                });
            });
        </script>
    </div>
</div>
<div class="clear"></div>

